1. Field of the Invention
The present invention relates to a method for error detection, a method for error logging in a memory, corresponding central processing units, a computer program as well as a computer program product.
2. Description of Related Art
Reference is made below to embedded systems in motor vehicles, as examples, without the present invention's being restricted to this application.
Embedded systems resemble usual computer systems in their design, and are made up of hardware and software. The software on such a system is called firmware, and is usually located in a ROM (read only memory), which is developed, for example, as a flash ROM. Besides that, an embedded system also has RAM (random access memory), which contains dynamic data and is typically executed as static RAM.
RAM is a memory whose content is available for use only as long as it is supplied with operating voltage. During the operation of an embedded systems, RAM is written on and read out as often as necessary. In the RAM, typically dynamic data and system values are stored, such as speed, acceleration, revolution numbers, sensor values, etc. To improve processing speed, a part of the program code that is to be executed may also, for example, be copied from the ROM into the RAM, and be executed there. Firmware, however, is usually executed directly from the ROM.
ROM is a durable memory that can be written on, which is only read out during the normal operating phase. Depending on the physical construction of the ROM, it can be written on once or several times. The memory content remains present, even without energy supply. The executable program code (firmware), and also constant data and parameters lie in the ROM of an embedded system.
Like most computer memories, RAM and ROM are made up of transistors and capacitors. Memory losses or memory errors are able to occur during operation. As causes, let us just cite, for example, radiation, electric loading and discharge, construction faults, etc.
Even just a single defective memory cell is able to cause an undesirable and dangerous erratic behavior of the system. In an embedded system for air bag control, if memory errors occur in the RAM that concern the values of acceleration, the result may be faulty triggering of air bags. A faulty ROM cell, in turn, may lead, for example, to a standstill of the system.
Therefore, RAM in embedded systems is monitored during operation, these days. If errors are detected, the system is thereupon put into a secure state, and the triggering of air bags is deactivated, for example. The errors are logged for later analysis.
ROM is usually checked regularly during the switching on process of the embedded system, and also during operation. If an error is detected in the ROM, the system is also transferred to a secure state and the error is logged.
The known methods for error detection and error logging are briefly explained below.
RAM Error Detection
During initialization, each memory cell is checked. The content of the memory cell is temporarily copied into a system register and the complement (0  1) of the memory content is restored. The cell is read out again and its content is compared to the complement of the content of the temporary register. If the two contents are in agreement, the storage cell is functional, otherwise it is defective. Finally, the content of the system register, that is, the original content of the cell, is restored again. This monitoring is carried out regularly during operation.
ROM Error Detection
ROM error detection is performed using check sums or CRC (cyclic redundancy check) methods. In both types of method a memory area in ROM is used for the check sum. The check sum is calculated in an external computer system, and at the first writing it is stored in the ROM together with the firmware. During operation, a check sum of the firmware is regularly calculated and compared to the stored check sum. If the check sums agree, the ROM is functional, otherwise it is flawed.
Error Logging
Error logging is carried out in a similar manner for both memory types. The content of the error protocol depends on the application. Typically, the error protocol includes the error location (RAM, ROM), the error number, a unique number being assigned to each error, the time (starting time) at which the error appeared for the first time, and perhaps the time (ending time), at which the error no longer occurred. The error protocol is stored in an additional, nonvolatile memory, such as an EEPROM. The software that executes the storing of the error protocol in the EEPROM, uses RAM and ROM regions which could themselves, in turn, be damaged. The time span that passes between the detection of an error and transition of the affected system to a secure state is relatively long, which is a disadvantage particularly in the case of safety-relevant systems, such as air bags.
In view of this state of the art, an object of the present invention is to make error detection and error logging faster and safer.